package com.fm.jbsql.sql;

/**
 * Created by IntelliJ IDEA.
 * User: syaroshenko
 * Date: Jul 13, 2006
 * Time: 11:36:27 AM
 * Class to create spcific instance of JBSQL-driver(sybase, mssql, mysql) based on type argument.
 */

/**
 * Class to create spcific instance of JBSQL-driver(sybase, mssql, mysql) based on type argument
 */
public final class DbDriverTypeSelector {
    /**
    * Class to create spcific instance of JBSQL-driver(sybase, mssql, mysql) based on type argument.
    * @param drivertype driver type
    * @return String
    */
    public static DbDriver getDriver(DbDriverType drivertype) {
        if ( drivertype == DbDriverType.EDT_MYSQL ) return new DbDriverMysql();
        else if ( drivertype == DbDriverType.EDT_MSSQL ) return new DbDriverMSSQL();
        else if ( drivertype == DbDriverType.EDT_SYBASE ) return new DbDriverSybase();
        else throw new NullPointerException();
    }
}
